package com.qlslylq.ad.sdk.application;

import android.app.Application;

import com.qlslylq.ad.sdk.core.ad.BaseAd;

import java.util.ArrayList;
import java.util.List;

/**
 * SDK全局控制类<br/>
 */
public class AdMergeSDKApp<T extends BaseAd> {

    private static AdMergeSDKApp app;

    //开屏缓存-广告池-矩阵
    private List<List<T>> splashPool = null;

    //插屏缓存-广告池-矩阵
    private List<List<T>> interstitialPool = null;

    //激励缓存-广告池-矩阵
    private List<List<T>> rewardPool = null;

    //全屏缓存-广告池-矩阵
    private List<List<T>> fullScreenPool = null;

    //横幅缓存-广告池-矩阵
    private List<List<T>> bannerPool = null;

    //信息流缓存-广告池-矩阵
    private List<List<T>> feedPool = null;

    private AdMergeSDKApp() {

    }

    public static Application getInstance() {
        return AdMergeSDK.getApp();
    }

    public static AdMergeSDKApp get() {
        if (app == null) {
            app = new AdMergeSDKApp();
        }
        return app;
    }

    public static boolean isTest() {
        return AdMergeSDK.getConfig().isTest();
    }

    public static boolean isDebug() {
        return AdMergeSDK.getConfig().isDebug();
    }

    public List<List<T>> getSplashPool() {
        if (splashPool == null) {
            splashPool = new ArrayList<>();
        }
        return splashPool;
    }

    public void setSplashPool(List<List<T>> splashPool) {
        this.splashPool = splashPool;
    }

    public List<List<T>> getInterstitialPool() {
        if (interstitialPool == null) {
            interstitialPool = new ArrayList<>();
        }
        return interstitialPool;
    }

    public void setInterstitialPool(List<List<T>> interstitialPool) {
        this.interstitialPool = interstitialPool;
    }

    public List<List<T>> getRewardPool() {
        if (rewardPool == null) {
            rewardPool = new ArrayList<>();
        }
        return rewardPool;
    }

    public void setRewardPool(List<List<T>> rewardPool) {
        this.rewardPool = rewardPool;
    }

    public List<List<T>> getFullScreenPool() {
        if (fullScreenPool == null) {
            fullScreenPool = new ArrayList<>();
        }
        return fullScreenPool;
    }

    public void setFullScreenPool(List<List<T>> fullScreenPool) {
        this.fullScreenPool = fullScreenPool;
    }

    public List<List<T>> getBannerPool() {
        if (bannerPool == null) {
            bannerPool = new ArrayList<>();
        }
        return bannerPool;
    }

    public void setBannerPool(List<List<T>> bannerPool) {
        this.bannerPool = bannerPool;
    }

    public List<List<T>> getFeedPool() {
        if (feedPool == null) {
            feedPool = new ArrayList<>();
        }
        return feedPool;
    }

    public void setFeedPool(List<List<T>> feedPool) {
        this.feedPool = feedPool;
    }
}
